<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var num1 = prompt('请输入第一个值');
        var num2 = prompt('请输入第二个值');
        var answer = parseFloat(num1)+parseFloat(num2);
        // alert(typeof answer)
        alert('结果是:'+answer);
    </script>
</head>
<body>

</body>
</html>